@if exist "%1" (
net stop SQLBrowser
net stop SQLServerAgent
net stop SQLWriter
net stop MSSQLSERVER
goto EndFlag
) else (
net start MSSQLSERVER
net start SQLBrowser
net start SQLWriter
net start SQLServerAgent
)

:EndFlag
timeout /t 3